{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function() {
  $('#itemName').focus();
});
function myFunction()
{
	if(confirm("Are You Sure To Delete")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
{/block}
{block name=body}
<form name="form1" method="post" action="item.php">
<table width="300" border="1" align="center" cellpadding="1" cellspacing="1">
<tr>
  <td colspan="3" align="center" class="table1"><strong>Item</strong></td>
</tr>
<tr>
  <td class="table1">Item Name :</td>
  <td class="table1"><input name="itemName" type="text" id="itemName" required /></td>
</tr>
<tr>
  <td class="table1">Item Unit :</td>
  <td class="table1">
  	<select name="itemUnit">
  		{html_options values=$unitValueArr output=$unitOutPutArr}
    </select>
  </td>
</tr>
<tr>
  <td  colspan="3" align="center" class="table1"><input type="submit" name="Submit" class="button" value="Submit"></td>
</tr>
</table>
</form>
<table align="center" border="2"> 
	<h2 align="center">Item List</h2>
	<tr>
		<th class="table1">&nbsp;</th>
		<th class="table1">Item Name</th>
		<th class="table1">Item Unit</th>
  </tr>
  {section name="sec" loop=$itemArray}
  <tr>
  	<td class="table1" align="center"><a href="itemDelete.php?itemId={$itemArray[sec].itemId}" onclick="return myFunction();" class="link"><img src="./images/deleteIco.png"></a></td>
  	<td class="table1" align="left">{$itemArray[sec].itemName}</td>
  	<td class="table1" align="left">{$itemArray[sec].itemUnit}</td>
  </tr>
  {/section}
</table>
{/block}